﻿Imports System.Data
Imports System.Data.OleDb
Public Class Excel_DAO
    Public Shared Function LayDLExcelNguoiThue(ByVal pacth As String, ByVal SheetName As String) As DataTable
        Dim cn As System.Data.OleDb.OleDbConnection = DataProvider.KetNoiExecl(pacth)
        Try
            Dim Mycommand As System.Data.OleDb.OleDbDataAdapter = New System.Data.OleDb.OleDbDataAdapter("select * from  [" & SheetName & "$]", cn)
            Dim DtSet As DataTable = New DataTable()
            Mycommand.Fill(DtSet)
            cn.Close()
            Return DtSet

        Catch ex As Exception

            cn.Close()
        End Try

    End Function
End Class
